Ext.define('Monkey.view.main.Viewport', {
    extend: 'Ext.container.Viewport',
    xtype: 'mainviewport',

    cls: 'mk-main-viewport',
    controller: 'ctrl-mainviewport',
    viewModel: {
        type: 'mainviewport'
    },

    id: 'mainView',
    layout: 'fit',
    items: [{
        border: false,
        layout: 'border',

        listeners: {
            //render: 'onMainViewRender'
        },
        items: [{
            region: 'north',
            xtype: 'toolbar',
            cls: 'mk-header',
            height: 60,
            items: [
                {
                    xtype: 'image',
                    src: 'resources/images/logo.png',
                    alt: 'Monkey logo',
                    height: 60
                },
                '->',
                //{
                //    xtype: 'segmentedbutton',
                //    cls: 'mk-hmenu',
                //    items: [{
                //        iconCls: 'x-fa fa-desktop',
                //        text: '系统管理',
                //        pressed: true
                //    }, {
                //        text: '项目导航',
                //        iconCls: 'x-fa fa-tablet'
                //    }, {
                //        text: '范例',
                //        iconCls: 'x-fa fa-tablet'
                //    }]
                //},
                {
                    xtype: 'tbtext',
                    text: '2016-08-25 星期四'
                },
                {
                    iconCls: 'x-fa fa-search',
                    text: '搜索',
                    tooltip: 'See latest search'
                },
                {
                    xtype: 'image',
                    cls: 'header-right-profile-image',
                    alt: '登录用户头像',
                    height: 35,
                    width: 35,
                    src: 'resources/images/2.png'
                },
                {
                    iconCls: 'x-fa fa-sign-out',
                    text: '退出',
                    tooltip: '退出系统',
                    handler: 'logout'
                }
            ]
        }, {
            region: 'west',
            xtype: 'tabpanel',
            cls: 'border-top-clear mk-west-menu',
            layout: 'fit',
            border: false,
            plain: true,
            width: 250,
            split: true,
            items: [{
                reference: 'navigation',
                cls: 'mk-navigation',
                title: '系统导航',
                layout: {
                    type: 'accordion',
                    animate: true
                }
            }, {
                title: '快捷菜单',
                xtype:'treepanel',
                rootVisible: false,
                store:'NavigationTree'
            }]
        }, {
            region: 'center',
            reference: 'mainTabPanel',
            xtype: 'tabpanel',
            border: false,
            layout: 'fit',
            plain: true,
            cls: 'border-top-clear',
            items: [{
                icon:'resources/icons/16/application_xp_terminal.png',
                title: '文档',
                html: '说明文档'
            }]
        }, {
            region: 'south',
            margin: '1 0 0 0',
            xtype: 'statusbar',
            text: '欢迎使用 MONKEY.',
            iconCls: 'x-fa fa-repeat'
        }]
    }]
});
